import 'package:flutter/material.dart';
import 'package:part_time_job_pro/common/models/sys_dict_data.dart';

class PartDetailState {
  late Map<String, dynamic> errorMsg;

  //滚动条透明度 默认不显示
  double scrollBarThickness = 0;

  //工作种类
  int workType = 0;

  //联系人
  late String contactName;

  //电话号码
  late String mobileText;

  //电子邮箱
  late String emailText;

  //报名人数
  int signUpCount = 0;

  //性别要求
  late List<SysDictData> selectUserSexList;
  late String selectUserSex;

  //薪资
  late double salary;

  //接收电话咨询
  late bool isAcceptMobileCall;

  //工作日期
  late String startDate;
  late String endDate;
  late DateTime initDate;
  late List<String> workDateList;

  //上班时间
  late String startTime;
  late String endTime;
  late DateTime initStartTime;
  late DateTime initEndTime;
  late List<String> workTimeList;

  //工作福利
  late List<SysDictData> workWelfareList;
  late String selectWorkWelfare;

  //工资单位
  late List<SysDictData> salaryUnitList;
  late String selectSalaryUnit;

  //结算周期
  late List<SysDictData> cashPeriodList;
  late String selectCashPeriod;

  //工作时间限制
  late List<SysDictData> workTimeLimitList;
  late String selectWorkTimeLimit;

  //每周上班天数
  late List<SysDictData> weekWorkDayList;
  late String selectWeekWorkDay;

  //是否显示下一步按钮
  late bool isShowNextStepButton;

  //岗位信息
  Map<String, dynamic> jobData = {};

  PartDetailState() {
    ///Initialize variables
    selectUserSex = "";
    emailText = "";
    salary = 0.0;
    mobileText = "";
    contactName = "";
    startTime = "08:00";
    endTime = "08:15";
    workDateList = [];
    salaryUnitList = [];
    cashPeriodList = [];
    workWelfareList = [];
    weekWorkDayList = [];
    workTimeLimitList = [];
    initDate = DateUtils.dateOnly(DateTime.now());
    startDate = "";
    endDate = "";
    selectSalaryUnit = "";
    selectCashPeriod = "";
    selectWorkWelfare = "";
    selectWeekWorkDay = "";
    selectWorkTimeLimit = "";
    isShowNextStepButton = true;
    errorMsg = {};

    initStartTime = DateTime(1, 1, 1, int.parse(startTime.split(":")[0]),
        int.parse(startTime.split(":")[1]));
    initEndTime = DateTime(1, 1, 1, int.parse(endTime.split(":")[0]),
        int.parse(endTime.split(":")[1]));
    workTimeList = [];
    isAcceptMobileCall = false;
  }
}
